﻿using System;
using NDBGen.Descriptors.Columns.Tokens;

namespace NDBGen.Plugins.Descriptors.Columns.Tokens
{
    public abstract class SqlServerColumnTokenScriptSnippetGeneratorBase : SqlServerColumnTokenScriptGeneratorBase<IColumnTokenDescriptor>
    {
    }

    public abstract class SqlServerColumnTokenScriptGeneratorBase<T> : SqlServerScriptSnippetGeneratorBase<T>, IColumnTokenScriptSnippetGenerator
        where T : IColumnTokenDescriptor
    {
        protected abstract void WriteSql(IIndentedTextWriter writer);
        
        void IColumnTokenScriptSnippetGenerator.WriteSql(IIndentedTextWriter writer)
        {
            this.WriteSql(writer);
        }

        void IGenerator<IColumnTokenDescriptor>.Init(IPluginData pluginData, IColumnTokenDescriptor descriptor)
        {
            base.Init(pluginData, (T)descriptor);
        }
    }
}